<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
</body>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.3.js"></script>
<script>
    $("li").each(function(idx,elem) {
    console.log(idx,elem);
    $(elem).html("修改后的内容"+idx)
    })
</script>
</html>